import request from '@/utils/request'
const baseURL = process.env.VUE_APP_BASE_URL
export function getAssettypesDetail(params) {
  return request({
    url: baseURL + '/superlink/api/assettypes/' + params,
    method: 'get',
  })
}
export function getAssetsList(params) {
  return request({
    url: baseURL + '/superlink/api/assets',
    method: 'get',
    params
  })
}
export function getAssetsDetails(params) {
  return request({
    url: baseURL + '/superlink/api/assets/' + params,
    method: 'get',
  })
}
export function formulaSplit(token, data) {
  return request({
    url: baseURL + `/superlink/api/production/formula/${token}/split`,
    method: 'post',
    data
  })
}
export function formulaList(params) {
  return request({
    url: baseURL + `/superlink/api/production/formulas`,
    method: 'get',
    params
  })
}
export function formulaDel(token) {
  return request({
    url: baseURL + `/superlink/api/production/delete/formula/${token}`,
    method: 'delete',
  })
}
export function taskDel(token) {
  return request({
    url: baseURL + `/superlink/api/production/delete/task/${token}`,
    method: 'delete',
  })
}
export function setAssetsList(data) {
  return request({
    url: baseURL + '/superlink/api/assets/create',
    method: 'post',
    data
  })
}
export function setAssetsType(data) {
  return request({
    url: baseURL + '/superlink/api/assettypes/create',
    method: 'post',
    data
  })
}
export function putAssetsType(data, token) {
  return request({
    url: baseURL + '/superlink/api/assettypes/update/' + token,
    method: 'put',
    data
  })
}
export function putAssetsList(data, token) {
  return request({
    url: baseURL + "/superlink/api/assets/update/" + token,
    method: 'put',
    data
  })
}
export function delAssets(data) {
  return request({
    url: baseURL + '/superlink/api/assets/delete/' + data,
    method: 'delete',
  })
}
export function getAssettypes(params) {
  return request({
    url: baseURL + '/superlink/api/assettypes',
    method: 'get',
    params
  })
}

export function getQrCode(assetTypeToken, generatorId) {
  return request({
    url: baseURL + `/assettypes/${assetTypeToken}/label/${generatorId}`,
    method: 'get',
  })
}
